package cloudoer.blog.entity;

import org.apache.ibatis.type.Alias;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 文章类
 */

@Alias(value = "Article")
public class Article implements Serializable {
    private String id;

    private String title;//文章标题

    private String text;//文章内容

    private String image;//首页图片

    private Date postdate;//发布时间

    private String source;//文章来源

    private Integer endorsecount;//点赞数量

    private Integer browsecount;//浏览数量

    private String ranking;//站长推荐值（值越大越靠前）

    private String typeid;//所属类型id

    private Type type;

    private List<Tag> tags = new ArrayList<Tag>();

    private static final long serialVersionUID = 1L;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id == null ? null : id.trim();
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title == null ? null : title.trim();
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text == null ? null : text.trim();
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image == null ? null : image.trim();
    }

    public Date getPostdate() {
        return postdate;
    }

    public void setPostdate(Date postdate) {
        this.postdate = postdate;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source == null ? null : source.trim();
    }

    public Integer getEndorsecount() {
        return endorsecount;
    }

    public void setEndorsecount(Integer endorsecount) {
        this.endorsecount = endorsecount;
    }

    public Integer getBrowsecount() {
        return browsecount;
    }

    public void setBrowsecount(Integer browsecount) {
        this.browsecount = browsecount;
    }

    public String getRanking() {
        return ranking;
    }

    public void setRanking(String ranking) {
        this.ranking = ranking == null ? null : ranking.trim();
    }

    public String getTypeid() {
        return typeid;
    }

    public void setTypeid(String typeid) {
        this.typeid = typeid == null ? null : typeid.trim();
    }

    public Type getType() {
        return type;
    }

    public void setType(Type type) {
        this.type = type;
    }

    public List<Tag> getTags() {
        return tags;
    }

    public void setTags(List<Tag> tags) {
        this.tags = tags;
    }

    @Override
    public String toString() {
        return "Article{" +
                "id='" + id + '\'' +
                ", title='" + title + '\'' +
                ", text='" + text + '\'' +
                ", image='" + image + '\'' +
                ", postdate=" + postdate +
                ", source='" + source + '\'' +
                ", endorsecount=" + endorsecount +
                ", browsecount=" + browsecount +
                ", ranking='" + ranking + '\'' +
                ", typeid='" + typeid + '\'' +
                ", type=" + type +
                '}';
    }
}